package com.example.demo.repository;

import com.example.demo.model.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

@Repository
public interface StudentRepository extends JpaRepository<Student, Integer> {
    @Query("SELECT s FROM Student s WHERE s.name LIKE %:name% OR s.tel LIKE %:name% OR CAST(s.age AS string) LIKE %:name%")
    List<Student> findByNameContaining(@Param("name") String name);
    List<Student> findByTel(String tel);
}